<template>
<view>
	<cu-custom bgColor="bg-gradual-blue" :isBack="true">
		<block slot="backText">返回</block>
		<block slot="content">大礼包</block>
	</cu-custom>		
<!-- 	<view class="package" v-if="list.length">	
		<view class="item" v-for="(item, index) in list" :key="index">
			<navigator :url="'/pages/spree/packageDetails?id='+item.id+service" hover-class="none">
				<image class="image" :src="item.default_imgurl"></image>
			</navigator>
			<view class="desc">{{item.package_name}}</view>
		</view>
	</view> -->	
	<block v-if="list.length">
		<view class="padding-bottom-sm">
			<view class="cu-card case no-card" v-for="(item, index) in list" :key="index">
				<navigator class="cu-item" :url="'/pages/spree/packageDetails?id='+item.id+service" hover-class="none">
					<view class="image">
						<image :src="item.default_imgurl" style="height: 300upx;"></image>
					<!-- 	<view class="cu-bar bg-shadeBottom"> <text class="text-cut">{{ item.package_name }}</text></view> -->
					</view>	
				</navigator>
			</view>			
		</view>
	</block>
	<empty-data v-else>什么也没有~</empty-data>
</view>
</template>

<script>
	import { PackageList } from '@/common/api/lbt'
	export default {
		name: 'PackageList',
		data () {
			return {
				list:[],
				tag: 0
			}
		},
		onLoad(opt) {
			let { level, ptype } = opt
			if (opt.tag) this.tag = opt.tag
			this.getInfo(opt.level, opt.ptype)
		},
		computed: {
			service () {
				return !this.tag ? '' : `&tag=${this.tag}`
			}
		},
		methods: {
			getInfo (level, ptype) {
				uni.showLoading()
				PackageList({ level, ptype }).then(res => {
					uni.hideLoading()
					if (!res.code) {
						this.list = res.data.data
					}
				})
			}
		}
	}
</script>

<style lang="less">
</style>
